﻿SmitearWebGL.Renderer.Renderer = SmitearWebGL.Core.ResourceItem.extend(
{
	/******** constructor ********/

	init : function()
	{
		this._super();
		
		this._registClass( "SmitearWebGL.Renderer.Renderer" );
	}
	,
	_initLayer : function( name, texture )
	{
		var layer = this.context.resourceManager.createResource( name, SmitearWebGL.Resources.MaterialLayer );
		if ( texture ) layer.setTexture( texture );
		
		return layer;
	}
	,
	_initMaterial : function( name, layers )
	{
		var material = this.context.resourceManager.createResource( name, SmitearWebGL.Resources.SurfaceMaterial );
		for ( var i = 0; i < layers.length; ++ i )
			material.addLayer( layers[i] );
			
		return material;
	}
	,
	_createResource : function( params )
	{
		this._super();
	}
	,
	_destroyResource : function()
	{
		this._super();
	}
}
);

SmitearWebGL.Renderer.Renderer.Type =
{
	FORWARD_RENDERER :			"__forward_renderer__",
	LIGHT_PRE_PASS_RENDERER :	"__light_pre_pass_renderer__",
	DEFERRED_SHADING_RENDERER :	"__deferred_renderer__",
	HDR_RENDERER :				"__hrd_renderer__"
}

SmitearWebGL.Renderer.Renderer.RenderStage =
{
	DEPTH :		0,
	NORMAL : 	1,
	MATERIAL :	2
}